import datetime
from haystack import indexes
from haystack import site
from profiles.models import Profile


class ProfileIndex(indexes.SearchIndex):
    text = indexes.CharField(document=True, use_template=True)
    user = indexes.CharField(model_attr='user')
    title = indexes.DateTimeField(model_attr='display_name')
    url = indexes.DateTimeField(indexed=False, use_template=True)


site.register(Profile, ProfileIndex)
